#include "widget.h"
#include "ui_widget.h"
#include<QTimer>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    time=new QTimer(this);
    connect(time,&QTimer::timeout,this,&Widget::updateProessbar);
    //隔多少ms发timeout信号
    time->start(100);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::updateProessbar()
{
    int value=ui->progressBar->value();
    if(value==10)return;
    ui->progressBar->setValue(value+1);
}

